package flink.examples;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import javax.xml.crypto.Data;

/**
 * @author : wuxinquan
 * @date: 2024/6/6 - 06 - 06 - 14:43
 * @Description: flink.examples
 * @version: 1.0
 */
public class FlinkDemo5 {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env=StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(2);
        DataStreamSource<Integer> ds1=env.fromElements(1,2,3);
        DataStreamSource<Integer> ds2 = env.fromElements(4, 5, 6);
        DataStreamSource<String> ds3 = env.fromElements("1", "2", "3");
        ds1.union(ds2,ds3.map(value->Integer.valueOf(value))).print();
        env.execute();
    }
}
